//导入
import Vue from "vue"
import Router from "vue-router"
// import Layout from "../pages/Layout";
// import vCenter from "../components/vCenter"
// import vGoods from "../components/vGoods"
// import vList from "../components/vList"
// import vMembers from "../components/vMembers"
const vList = () => import ("../store/initfourvue/vList")
const vCenter = () => import ("../store/initfourvue/vCenter")
const vMembers = () => import ("../store/initfourvue/vMembers")


const Banner = () => import ("../components/Banner")
const Home = ()=>import("../pages/Home")
const Register = () => import("../pages/Register")
const Login =()=>import("../pages/Login")
const Layout = ()=>import("../pages/Layout")
const Menu = ()=>import("../pages/Menu")
const Role =() =>import("../pages/Role")
const Admin =()=>import("../pages/Admin")
const Category =()=>import("../pages/Category")
const Specs = ()=>import("../pages/Specs")
const GoodsM = ()=>import("../pages/GoodsM")
const Good = ()=>import("../pages/Good")

//注册插件
Vue.use(Router)

let routes = [
    {
        path: "/",
        redirect: "/login"
    },
    {
        path: "/main",
        name: "main",
        component:Layout,
        children: [
            {
              path:"/home",
                name:"home",
                component:Home
            },
            {
                path:"/vcenter",
                name:"vcenter",
                component:vCenter
            },
            {
                path:"/banner",
                name:"banner",
                component: Banner
            },
            {
                path: "/vlist",
                name: "vlist",
                component: vList
            },
            {
                path: "/vmembers",
                name: "vmembers",
                component: vMembers
            },
            {
                path:'/menu',
                name:"menu",
                component:Menu
            },
            {
                path:"/role",
                name:"role",
                component:Role
            },
            {
                path:"/admin",
                name:"admin",
                component:Admin
            },
            {
                path:"/category",
                name:"category",
                component:Category
            },
            {
                 path:"/specs",
                 name:"specs",
                 component:Specs
            },
            {
                path:'/goodsm',
                name:'goodsm',
                component:GoodsM
            },
            {
                path:'/good',
                name:'good',
                component:Good
            }
        ]
    },
    {
        path:"/register",
        name:"register",
        component:Register
    },
    {
        path:"/login",
        name:"login",
        component:Login
    },


]

let router = new Router({
    routes: routes,
    linkActiveClass: "active",
    linkExactActiveClass: "active"

})
export default router
